#ifndef DBUS_ADAPTOR_H
#define DBUS_ADAPTOR_H
#include "mainwindow.h"

extern MainWindow *w;
class MainApplicationAdaptor: public QDBusAbstractAdaptor
         {
             Q_OBJECT

             Q_CLASSINFO("D-Bus Interface", "org.kde.DBus.TPlayer")
            // Q_PROPERTY(QString caption READ caption WRITE setCaption)
            // Q_PROPERTY(QString organizationName READ organizationName)
            // Q_PROPERTY(QString organizationDomain READ organizationDomain)

         private:
             QApplication *app;

         public:
             MainApplicationAdaptor(QApplication *application)
                 : QDBusAbstractAdaptor(application), app(application)
             {
                connect (w,SIGNAL(track_change(QString)),this,SIGNAL(change_track(QString)));
             }

            // QString track_path()
            // {                return QString(w->currentTrack_path);
            // }


         public slots:
             Q_NOREPLY void track_next() { w->next(); }
             Q_NOREPLY void track_prev() { w->prev(); }
             Q_NOREPLY void track_play_pause() { w->play_pause(); }

         private slots:
         signals:
             void change_track(QString);

         };

#endif // DBUS_ADAPTOR_H
